Skip to content

implements a custom typescript config possibility in compilers/typesc… #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

webforgeeu
Copy link

…ript-compiler.js

If a tsconfig.jest.json is found it will load that one instead of the default tsconfig.json

…ript-compiler.js

If a tsconfig.jest.json is found it will load that one instead of the default tsconfig.json
if (!fs.existsSync(tscPath+ '/'+ tscFile)){
tscFile = false
}
const { config } = tsconfig.loadSync(tscPath, tscFile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use a jest global to get the file name, similarly to how ts-jest does it—https://github.com/kulshekhar/ts-jest/blob/master/src/preprocessor.ts#L17

You can pass a global in in the Jest config object:

{
  "jest": {
    "globals": {
      "vue-jest": {
        "tsConfigFile": "my-tsconfig.json"
      }
    }
  }
}

Copy link
Member

@eddyerburgh eddyerburgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR 😀

In order to get this merged in, we should refactor it to use a jest config value for the filename.

We also need to add tests to check that this works correctly

@@ -1,11 +1,13 @@
# vue-jest
# vue-jest-kn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you changed the package name?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to change it temporarily to have an npm with it to integrate.
Will be changed back once I have the time to refactor to jest-globals.
Should have made another fork .. my bad ;)

@btoo btoo mentioned this pull request Mar 16, 2018
@dcherman
Copy link
Contributor

@webforgeeu Are you still interested in working on this? I need this as well, but don't want to step on your toes if you're actively working on it / completing it soon.

@webforgeeu
Copy link
Author

@dcherman
Feel free to take that on.
My workload is a bit too high at the moment as I'd afford to spend time on that.
I'd be more than happy to help out if you need some support here and there, but I'm afraid I can't complete that in the next weeks or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants